/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.icatportal.client.mvc;

import com.extjs.gxt.ui.client.mvc.AppEvent;
import com.extjs.gxt.ui.client.mvc.Controller;
import org.icatportal.client.AppEvents;

/**
 *
 * @author ll56
 */
public class PreferenceController extends Controller {

    private PreferenceFolderView folderView;
    private PreferenceView preferenceView;

    public PreferenceController() {
        registerEventTypes(AppEvents.Init);
        registerEventTypes(AppEvents.NavPreference);
    }

    @Override
    public void initialize() {
        super.initialize();
        folderView = new PreferenceFolderView(this);
        preferenceView = new PreferenceView(this);
    }

    public void handleEvent(AppEvent event) {
        if (event.type == AppEvents.Init) {
            forwardToView(folderView, event);
        }
        if (event.type == AppEvents.NavPreference) {
            forwardToView(preferenceView, event);
        }
    }
}

